package com.shi.method_reference;

import java.util.Arrays;

public class Demo02 {
    public static void main(String[] args) {
        Integer[] arr = {3, 5, 4, 1, 6, 2};

        //方法引用
        Arrays.sort(arr, Demo02::subtraction);

        System.out.println(Arrays.toString(arr));
    }

    public static int subtraction (int a, int b) {
        return a - b;
    }
}
